mui.init({swipeBack: false});
/*------ 滚动图片自动播放代码 CODE START -----*/
var slider = mui("#slider");
slider.slider({interval: 5000});
/*------ 滚动图片自动播放代码 CODE END -----*/

/*------ Tab选项卡代码 CODE START -----*/
(function($) {
	var contentEle = document.getElementById("mui-content");
	var tabPanel = document.getElementById('cmw-tabPanel');
	var tabHeight = contentEle.clientHeight;
	tabPanel.style.height = tabHeight+"px";
	$('.mui-scroll-wrapper').scroll({
		indicators: true //是否显示滚动条
	});
	
	//var html2 = '<ul class="mui-table-view"><li class="mui-table-view-cell">第二个选项卡子项-1</li><li class="mui-table-view-cell">第二个选项卡子项-2</li><li class="mui-table-view-cell">第二个选项卡子项-3</li><li class="mui-table-view-cell">第二个选项卡子项-4</li><li class="mui-table-view-cell">第二个选项卡子项-5</li></ul>';
	//var html3 = '<ul class="mui-table-view"><li class="mui-table-view-cell">第三个选项卡子项-1</li><li class="mui-table-view-cell">第三个选项卡子项-2</li><li class="mui-table-view-cell">第三个选项卡子项-3</li><li class="mui-table-view-cell">第三个选项卡子项-4</li><li class="mui-table-view-cell">第三个选项卡子项-5</li></ul>';
	var item2 = document.getElementById('item2mobile');
	var item3 = document.getElementById('item3mobile');
	showTabContent(item2,html2);
	tabPanel.addEventListener('slide', function(e) {
		if (e.detail.slideNumber === 0) {
			activeTabItem(item2,item3);
			showTabContent(item2,html2+html2+html2+html2);
		} else if (e.detail.slideNumber === 1) {
			activeTabItem(item3,item2);
			showTabContent(item3,html3+html3+html3+html3);
		}
	});
	
	function showTabContent(item,html){
		if (item.querySelector('.mui-loading')) {
			setTimeout(function() {
				item.querySelector('.mui-scroll').innerHTML = html;
			}, 1000);
		}
	}
	
	function activeTabItem(activeEle,unEle){
		CmwMcore.addClass(activeEle,"mui-active");
		CmwMcore.removeClass(unEle,"mui-active");
	}
})(mui);
/*------ Tab选项卡代码 CODE END -----*/